package com.xzy.generic.bad.example.c;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.EventListener;

/**
 * 事件监听器
 *
 * @author xzy.xiao
 * @date 2023/2/28  20:03
 */
class AaaEventListener {

    Logger logger = LoggerFactory.getLogger(AaaEventListener.class);

    /*
     * 下面三种写法，都会接收到所有的GenericEvent，不管你携带的eventData到底是什么类型
     *
     */

    @EventListener
    public void onAaaEvent0(GenericEvent<AaaData> genericEvent) {
        logger.info("onAaaEvent0 监听到事件：{}", genericEvent);
        // TODO:
    }

    @EventListener
    public void onAaaEvent1(GenericEvent<Object> genericEvent) {
        logger.info("onAaaEvent2 监听到事件：{}", genericEvent);
        // TODO:
    }

    @EventListener
    public void onAaaEvent2(GenericEvent<?> genericEvent) {
        logger.info("onAaaEvent1 监听到事件：{}", genericEvent);
        // TODO:
    }

}
